package com.iss.airsys.service;

import com.iss.airsys.dao.UserInfoDao;
import com.iss.airsys.entity.Userinfo;
import com.iss.airsys.model.UserinfoWithUserWithRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoService {
    private int count;
    @Autowired
    UserInfoDao dao;
    public boolean insertPeople(Userinfo userinfo){
        count= dao.insertPeople(userinfo);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }
    public boolean deletePeople(String [] uInfo_names){
        count= dao.deletePeople(uInfo_names);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }
    public boolean updatePeople(Userinfo userinfo){
        count= dao.updatePeople(userinfo);
        if (count>0){
            return true;
        }else {
            return false;
        }
    }
    public List<UserinfoWithUserWithRole> selectAll(){
        return dao.selectAll();

    }
    public Userinfo selectUserinfobyName(String uInfo_name){
        return dao.selectUserinfobyName(uInfo_name);

    }





}
